package com.fs.common.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fs.common.json.JacksonObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;

@Configuration
public class JacksonConfig {

    @Bean
    public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) {
        // 使用你的自定义 JacksonObjectMapper
        ObjectMapper objectMapper = new JacksonObjectMapper();
        // 可选：通过 builder 进一步定制（如果需要 Spring 默认配置）
        builder.configure(objectMapper);
        return objectMapper;
    }
}